[LIBXC] Fix non-x86 build.
authorkaf24@localhost.localdomain <kaf24@localhost.localdomain>
Sun, 21 Jan 2007 15:39:04 +0000 (15:39 +0000)
committerkaf24@localhost.localdomain <kaf24@localhost.localdomain>
Sun, 21 Jan 2007 15:39:04 +0000 (15:39 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xc_resume.c

index ea9e121054f088a80c9b7c3d10fa9a6f298ff268..ef8b82669a1017c8c2bd3088c9a2b0dcf2987267 100644 (file)
@@ -1,5 +1,28 @@
 #include "xc_private.h"
 
+
+#if defined(__i386__) || defined(__x86_64__)
+static int modify_returncode(int xc_handle, uint32_t domid)
+{
+    vcpu_guest_context_t ctxt;
+    int rc;
+
+    if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+        return rc;
+    ctxt.user_regs.eax = 1;
+    if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+        return rc;
+
+    return 0;
+}
+#else
+static int modify_returncode(int xc_handle, uint32_t domid)
+{
+    return 0;
+}
+#endif
+
+
 /*
  * Resume execution of a domain after suspend shutdown.
  * This can happen in one of two ways:
@@ -13,7 +36,6 @@
  */
 int xc_domain_resume(int xc_handle, uint32_t domid)
 {
-    vcpu_guest_context_t ctxt;
     DECLARE_DOMCTL;
     int rc;
 
@@ -21,13 +43,8 @@ int xc_domain_resume(int xc_handle, uint32_t domid)
      * Set hypercall return code to indicate that suspend is cancelled
      * (rather than resuming in a new domain context).
      */
-#if defined(__i386__) || defined(__x86_64__)
-    if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
-        return rc;
-    ctxt.user_regs.eax = 1;
-    if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+    if ( (rc = modify_returncode(xc_handle, domid)) != 0 )
         return rc;
-#endif
 
     domctl.cmd = XEN_DOMCTL_resumedomain;
     domctl.domain = domid;